{# 表格模块 - 机构调研报告列表 #}
<div class="mod-table-container">
    <div class="section-title">机构调研报告（{{ '沪市' if market == 'sh' else '深市' }}）</div>
    <table class="report-table">
        <thead>
            <tr>
                <th scope="col">标题</th>
                <th scope="col">日期</th>
            </tr>
        </thead>
        <tbody>
            {% for item in data %}
            <tr>
                <td>
                    {% if item.fileType %}
                        {% if item.fileType == 'pdf' %}
                            <span class="file-tag file-pdf">[PDF]</span>
                        {% elif item.fileType in ['doc','docx'] %}
                            <span class="file-tag file-doc">[DOC]</span>
                        {% endif %}
                    {% endif %}
                    <a href="{{ item.adjunctUrl }}" target="_blank">{{ item.announcementTitle }}</a>
                </td>
                <td>{{ item.announcementTime }}</td>
            </tr>
            {% endfor %}
            {% if data|length == 0 %}
            <tr><td colspan="2">暂无调研报告</td></tr>
            {% endif %}
        </tbody>
    </table>
</div>

{# 分页块 - 极简版 #}
{% if pages and page %}
<div class="pagination">
    <div class="pagination-links">
        {% if page > 1 %}
            <a href="{{ request.url.replace_query_params(page=page-1) }}" class="page-link prev-page">‹</a>
        {% endif %}

        {# 只显示当前页和总页数 #}
        <span class="page-info">{{ page }} / {{ pages }}</span>

        {% if page < pages %}
            <a href="{{ request.url.replace_query_params(page=page+1) }}" class="page-link next-page">›</a>
        {% endif %}
    </div>

    {% if pages > 3 %}
    <div class="page-jump">
        <form method="get" class="jump-form">
            {% for key, value in request.query_params.items() if key != 'page' %}
            <input type="hidden" name="{{key}}" value="{{value}}">
            {% endfor %}
            <input type="number" name="page" min="1" max="{{pages}}" value="{{page}}" class="jump-input" placeholder="页">
            <button type="submit" class="jump-button">跳转</button>
        </form>
    </div>
    {% endif %}
</div>
{% endif %}

